<!-- 废弃掉一期的样式，全新的样式 -->
<template>
    <view class="nova-column box" v-if="owner">
        <text class="title">业主信息</text>

        <block v-for="(item, index) in descArr" :key="index">
            <view v-if="item.phone" class="nova-row-center">
                <text class="line">{{ item.label }}</text>
                <text class="line link value" space="nbsp" @click="showPhone(item)">点击显示</text>
            </view>
            <view v-else class="nova-row-center">
                <text class="line">{{ item.label }}</text>
                <text class="line value">{{ item.value }}</text>
            </view>
        </block>
<!--        <view class="nova-row-center" v-if="owner.authentication">
            <view class="tag" v-for="v in owner.authentication" :key="v">{{ v.type }}</view>
        </view> -->
    </view>
</template>

<script>
export default {
    name: 'c-job-owner',
    props: {
        owner: {
            type: Object,
            default: () => {}
        }
    },
    data() {
        return {
            descArr: []
        };
    },
    created() {
        let arr = [];
        if (this.owner.name) {
            arr.push({
                label: '姓名: ',
                value: this.owner.name
            });
        }
        if (this.owner.contact || this.owner.phone) {
            arr.push({
                label: '电话: ',
                value: this.owner.contact || this.owner.phone,
                phone: true
            });
        }
        if (this.owner.village) {
            arr.push({
                label: '地址: ',
                value: this.owner.village
            });
        }
        this.descArr = arr;
    },
    methods: {
        showPhone(item) {
            item.phone = false;
        }
    }
};
</script>

<style lang="scss">
.box {
    padding: 20rpx 34rpx;
    .title {
        font-size: 30rpx;
        color: #333;
        padding-bottom: 20rpx;
    }
    .line {
        font-size: 26rpx;
        color: #999;
        line-height: 40rpx;
    }
    .value {
        padding-left: 20rpx;
    }
    .link {
        color: $uni-color-primary;
    }
    .tag {
        border-radius: 10rpx;
        font-size: 22rpx;
        color: $uni-color-primary;
        height: 36rpx;
        line-height: 36rpx;
        margin-right: 24rpx;
        padding: 0 10rpx;
        border: 1rpx solid $uni-color-primary;
    }
}
</style>
